{include file="public/header" /}
<style>
body{
  background: #FFF;
}
dl{
    display: flex;
    align-items: center;
    margin: 10px 0;
}

dl dt{
    flex: 0 0 100px;
}

dl dd{

}
</style>

<div class="page">
    <table class="ds-default-table order">
        <tbody>
           

        <tr>
            <th>{$Think.lang.order_info}</th>
        </tr>
        <tr>
            <td colspan="2">
                <ul>
                    <li><strong>{$Think.lang.ds_order_sn}:</strong>{$order_info.order_sn}</li>
                    <li><strong>{$Think.lang.order_state}:</strong>{$order_state[$order_info.order_state]}</li>

                    <?php
                         if($order_info['order_state'] == 6){
                    ?>
                            <li><strong>审核失败原因:</strong>{$order_info.examine_failed_reason}</li>
                    <?php
                        }
                    ?>
                    <li><strong>订单类型:</strong>{$order_type[$order_info.order_type]}</li>
                    <li><strong>订单预约时间:</strong>{$order_info.appointment_time}</li>
                    <li><strong>订单创建时间:</strong>{$order_info.add_time|date="Y-m-d H:i:s",###}</li>
                    <li><strong>订单备注:</strong>{$order_info.remarks}</li>
                    
                    <li><strong>管理员备注:</strong>{$order_info.manager_remark}</li>
                    <li><strong>服务内容:</strong>{$order_info.service_content}</li>
                </ul>
            </td>
        </tr>
        <?php
            if($order_info['parent_id'] == 0){
        ?>
        <tr>
            <th>订单价格信息</th>
        </tr>
        <tr>
            <td colspan="2">
                <ul>
                    <li><strong>总订单费用:</strong>{$order_info.order_amount}</li>
                    <li><strong>上门费用:</strong>{$order_info.door_fee}</li>
                    <li><strong>工时合计:</strong>{$order_info.work_master_hous}</li>
                    <li><strong>工时费用合计:</strong>{$order_info.work_master_price}</li>
                    <li><strong>服务人员总费用:</strong>{$order_info.assign_mechanic_total}</li>
                    <li><strong>配件总费用:</strong>{$order_info.part_price}</li>
                </ul>
            </td>
        </tr>
        <?php
            }
        ?>

        {notempty name="order_info.address"}
        <tr>
            <th>客户信息</th>
        </tr>
        <tr>
            <td>
                <ul>
                    <li><strong>客户姓名{$Think.lang.ds_colon}</strong>{$order_info.address.address_realname}</li>
                   <li><strong>客户电话:</strong>{$order_info.appoint_phone}</li>
                    <li><strong>客户地址{$Think.lang.ds_colon}</strong>{$order_info.appoint_address}&nbsp;{$order_info.appoint_detail_address}&nbsp;</li>
                </ul>
            </td>
        </tr>
        {/notempty}
        <tr>
            <th>服务设备列表
            </th>
        </tr>

        <tr>
            <td><table class="ds-default-table goods ">
                <tbody>
                <tr>
                    <th class="align-center">设备编号</th>
                    <th class="align-center">设备名称</th>
                    <th class="align-center">品牌</th>

                    <th class="align-center">操作</th>
                </tr>
                {foreach name="$order_info.goods_items" item="goods"}
                <tr>
                    <td class="w20 align-center"><p>{$goods.goods_id}</p></td>
                    <td class="w20 align-center"><p>{$goods.goods_name}</p></td>
                    <td class="w20 align-center"><span class="red_common">{$goods.b_name}</span></td>

                    <td class="w96 align-center">
                        <a href="javascript:dsLayerOpen('{:url('Service/show_detail',['id'=>$goods.id])}','{$Think.lang.ds_view} 子订单详情')" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
                    </td>

                </tr>
                {/foreach}
                </tbody>
            </table>
            </td>
        </tr>
          
            <tr>
                <th>审核</th>
            </tr>
            <form action="" method="post">
                <input type="hidden" name="cancel_id"  readonly value="{$cancel_info.cancel_id}">
            <tr>
             <td style="border:none;">
                <dl>
                    <dt>取消原因:</dt>
                    <dd>
                        <input type="text" name="code" id="code" readonly value="{$cancel_info.cancel_reason}">
                    </dd>
                </dl>
                <dl>
                    <dt>取消说明:</dt>
                    <dd class="vatop rowform">
                        <textarea rows="6" class="tarea" cols="30"  readonly>{$cancel_info.cancel_remake}</textarea>
                        </dd>
                </dl>

                <dl>
                    <dt>审核:</dt>
                    <dd>
                        <select name="status" id="status">
                            <option value="1">通过</option>
                            <option value="0">未通过</option>
                        </select></dd>
                </dl>
            <dl class="noborder" dstype="reason" style="display :none;">
                <dt>未通过原因:</dt>
                <dd class="vatop rowform"><textarea rows="6" class="tarea" cols="60" name="no_content" id="verify_reason"></textarea></dd>
            </dl>
            </td>
            </tr>
            <tr>
                <td style="border: none;"><input type="submit" value="提交"></td>
            </tr>
            </form>
        </tbody>
    </table>
</div>
<script>

    $(document).ready(function () {
        $("form").submit(function (e) {
            var status = $('#status').val();
            var invoice_type = $('#status').attr('invoice_type');
            var no_content = $('#verify_reason').val();

            var code = $('#code').val();
            if(status==0 && no_content.replace(/\s+/g,"") == ''){
               layer.msg('请填写未通过原因');return false;
            }

        });
    });

    $(function() {
        $('#status').change(function() {
            //alert($(this).val());return false;
            if ($(this).val() == '1') {
                $('dl[dstype="reason"]').hide();
                $('#wuliu_code').show();
            } else {
                $('dl[dstype="reason"]').show();
                $('#wuliu_code').hide();
            }
        });
    });

</script>